package com.ruoyi.pointRecord.service.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pointRecord.mapper.PointsExchangeRecordMapper;
import com.ruoyi.pointRecord.domain.PointsExchangeRecord;
import com.ruoyi.pointRecord.service.IPointsExchangeRecordService;

/**
 * 积分兑换记录Service业务层处理
 * 
 * @author amy
 * @date 2025-06-17
 */
@Service
public class PointsExchangeRecordServiceImpl implements IPointsExchangeRecordService 
{
    @Autowired
    private PointsExchangeRecordMapper pointsExchangeRecordMapper;

    /**
     * 查询积分兑换记录
     * 
     * @param id 积分兑换记录主键
     * @return 积分兑换记录
     */
    @Override
    public PointsExchangeRecord selectPointsExchangeRecordById(Long id)
    {
        return pointsExchangeRecordMapper.selectPointsExchangeRecordById(id);
    }

    /**
     * 查询积分兑换记录列表
     * 
     * @param pointsExchangeRecord 积分兑换记录
     * @return 积分兑换记录
     */
    @Override
    public List<PointsExchangeRecord> selectAllPointsExchangeRecordList(PointsExchangeRecord pointsExchangeRecord)
    {
        return pointsExchangeRecordMapper.selectAllPointsExchangeRecordList(pointsExchangeRecord);
    }

    /**
     * 查询用户积分兑换记录
     *
     * @param pointsExchangeRecord 积分兑换记录
     * @return 积分兑换记录集合
     */
    @Override
    public List<PointsExchangeRecord> selectUserPointsExchangeRecordList(PointsExchangeRecord pointsExchangeRecord) {
        pointsExchangeRecord.setUserId(SecurityUtils.getUserId());
        return pointsExchangeRecordMapper.selectUserPointsExchangeRecordList(pointsExchangeRecord);
    }

    /**
     * 新增积分兑换记录
     * 
     * @param pointsExchangeRecord 积分兑换记录
     * @return 结果
     */
    @Override
    public int insertPointsExchangeRecord(PointsExchangeRecord pointsExchangeRecord)
    {
        return pointsExchangeRecordMapper.insertPointsExchangeRecord(pointsExchangeRecord);
    }

    /**
     * 修改积分兑换记录
     * 
     * @param pointsExchangeRecord 积分兑换记录
     * @return 结果
     */
    @Override
    public int updatePointsExchangeRecord(PointsExchangeRecord pointsExchangeRecord)
    {
        return pointsExchangeRecordMapper.updatePointsExchangeRecord(pointsExchangeRecord);
    }

    /**
     * 批量删除积分兑换记录
     * 
     * @param ids 需要删除的积分兑换记录主键
     * @return 结果
     */
    @Override
    public int deletePointsExchangeRecordByIds(Long[] ids)
    {
        return pointsExchangeRecordMapper.deletePointsExchangeRecordByIds(ids);
    }

    /**
     * 删除积分兑换记录信息
     * 
     * @param id 积分兑换记录主键
     * @return 结果
     */
    @Override
    public int deletePointsExchangeRecordById(Long id)
    {
        return pointsExchangeRecordMapper.deletePointsExchangeRecordById(id);
    }
}
